//用于生产环境克服服务器周期性延时的问题
const http = require("http");
const { setInterval } = require("timers");
const Url = "http://www.dearduo.com/api/page/InfoTypeList"
const S = 1200;
function Myget() {
    return new Promise(resolve => {
        http.get(Url, res => {
            resolve(res.statusCode);
        })
    });
}

async function run() {
    console.time("time");
    const res = await Myget();
    console.timeEnd("time");
    setInterval(async () => {
        console.time("time");
        const res = await Myget();
        console.timeEnd("time");
    }, 1000 * S);

}
run();